-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
stage2: add TD Partitioning support #419
Conversation
285a867
to
a323d9f
Compare
Will update this PR again after #432 is merged since that impacts our stage1 trampoline logic |
a323d9f
to
01a984d
Compare
PR updated. TDP boots stage2 with stage2 moved to 8MB. |
01a984d
to
c70ec34
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I pointed out two problems which need fixing, other than that it looks good to me. With the log::info!
issue fixed it boots for me on SNP and testing passes.
Since both the stage2 bootloader and the SVSM kernel dump the CPUID page, there needs to be a page present at the respective GPA on TDP platforms. Insert a normal zero page at the CPUID page location so that dump_cpuid_table() can work as expected. Signed-off-by: Peter Fang <[email protected]>
Since the SVSM kernel touches the secrets page in svsm_start(), there needs to be a page present at the respective GPA on TDP platforms. Insert a normal zero page at the secrets page location so that the SVSM kernel can touch it without issues. Signed-off-by: Peter Fang <[email protected]>
Clean up formatting and crate ordering. Signed-off-by: Peter Fang <[email protected]>
Add the tdx-tdcall crate in preparation for the upcoming TDX enabling changes. Signed-off-by: Peter Fang <[email protected]>
Stage2LaunchInfo has been increased to 48 bytes. Make the according changes in stage1 trampoline. Signed-off-by: Peter Fang <[email protected]>
Setting the initial location counter has no effect since all of the addresses before edata are derived based on the subsequent locations. Signed-off-by: Peter Fang <[email protected]>
Add GHCI-based PIO driver to TdpPlatform. This implementation translates all of the in/out operations to TDVMCALL operations as required by the GHCI spec. Additionally, move console initialization to env_setup() to enable it as early as possible. Signed-off-by: Peter Fang <[email protected]>
Make stage2 a tad more verbose by signaling when it's about ready to jump into the SVSM kernel. Signed-off-by: Peter Fang <[email protected]>
phys_addr_sizes should be the entirety of CPUID leaf 0x80000008.EAX, not just the Physical Address Bits field. Signed-off-by: Peter Fang <[email protected]>
c70ec34
to
1a551a2
Compare
Updated this PR after #463 got merged |
This is in preparation for the upcoming changes to PageTable::virt_to_phys(). Since 1G huge pages are architecturally permissible when translating a virtual address, PAGE_SIZE_1G is now a valid page size even though it's currently not actively used anywhere. Signed-off-by: Peter Fang <[email protected]>
PageFrame is an enum describing not only a physical address, but also the page frame to which it belongs. - PageFrame::address(): return its internal PhysAddr - PageFrame::start(): return the beginning of the page frame - PageFrame::end(): return the end of the page frame Signed-off-by: Peter Fang <[email protected]>
virt_to_frame() not only returns the translated physical address, but also returns the size of the underlying page through PageFrame. Signed-off-by: Peter Fang <[email protected]>
On TDP platforms, page validation means page acceptance. Implement validate_{physical, virtual}_page_range() using the tdx-tdcall crate for this TDCALL operation. Page invalidation simply means zeroing out the page on TDP platforms. Signed-off-by: Peter Fang <[email protected]>
1a551a2
to
a422374
Compare
Updated the PR based on feedback |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me now.
This is the second half of the TDX enabling work in stage2. It enables SVSM running on a TDP platform to boot until the last jump in stage2_main(). It also adds support for serial console.